#include "stdafx.h"

BOOL FourEdges::Sort()
{
	POINT *TEMP1;
	if (this->a.x > this->b.x)
	{
		TEMP1 = this->a;
		this->a = this->b;
		this->b = TEMP1;
	}
	if (this->b.x > this->c.x)
	{
		TEMP1 = this->b;
		this->b = this->c;
		this->c = TEMP1;
	}
	if (this->c.x > this->d.x)
	{
		TEMP1 = this->c;
		this->c = this->d;
		this->d = TEMP1;
	}
	if (this->a.x > this->b.x)
	{
		TEMP1 = this->a;
		this->a = this->b;
		this->b = TEMP1;
	}
	if (this->b.x > this->c.x)
	{
		TEMP1 = this->b;
		this->b = this->c;
		this->c = TEMP1;
	}
	if (this->a.x > this->b.x)
	{
		TEMP1 = this->a;
		this->a = this->b;
		this->b = TEMP1;
	}
	if (this->b.x > this->c.x)
	{
		TEMP1 = this->b;
		this->b = this->c;
		this->c = TEMP1;
	}
	return TRUE;
}

int FourEdges::FourEdges
{
	a = new POINT;
	b = new POINT;
	c = new POINT;
	d = new POINT;
}
int FourEdges::~FourEdges
{
	delete a;
	delete b;
	delete c;
	delete d;
}

BOOL FourEdges::GetLimits(COUPLEOFPOINTS *result[])
{
	for (int i = this->a->y); i < this->b->y; i++)
	{
		result[i]->y = i;
		
	}
}